//package com.kehutong.house.app;
//
//import java.util.Collections;
//import java.util.List;
//
//import org.coraframework.inject.Inject;
//import org.coraframework.json.JSONObject;
//import org.coraframework.mvc.MvcAction;
//import org.coraframework.mvc.http.ReqMapping;
//import org.coraframework.mvc.http.result.Result;
//import org.coraframework.orm.jdbc.SQLSession;
//import org.coraframework.util.Objects;
//
//import com.kehutong.employee.entity.Employee;
//import com.kehutong.employee.service.EmployeeService;
//import com.kehutong.house.entity.Community;
//import com.kehutong.session.entity.Session;
//
//@MvcAction
//@ReqMapping("/app/community")
//public class CommunityAction {
//
//	@Inject
//	private SQLSession sqlSession;
//	@Inject
//	private EmployeeService employeeService;
//
//	@ReqMapping("/list")
//	public Object list(JSONObject jsonObject) {
//		List<Community> communitys = sqlSession.findArray(Community.class)
//				.eq(jsonObject, "companyNo", "provinceName", "cityName", "regionName")
//				.eq("deleted", false)
//				.exe();
//
//		return Result.success(communitys);
//	}
//
//	@ReqMapping("/employeeList")
//	public Object employeeList(Session session) {
//		Employee employee = employeeService.getEmployeeById(session.getUserNo());
//		if (Objects.isEmpty( employee.getInnerDepartment())) {
//			return Collections.emptyList();
//		}
//
//		final List<Community> list = sqlSession.findArray(Community.class)
//					   .eq("companyNo", session.getCompanyNo())
//					   .in("id", employee.getInnerDepartment())
//					   .eq("deleted", false)
//					   .exe();
//
//		return Result.success(list);
//	}
//
//}
